﻿using System.Collections.Generic;

namespace PoliticalClassifier.Support
{
    /// <summary>
    /// IDataSourceLoadResults provides a container and API for checking 
    /// the results of loading a data file.
    /// </summary>
    public interface IDataSourceLoadResults
    {
        /// <summary>
        /// Gets whether or not the data is in good enough shape to process.
        /// </summary>
        bool CanContinue { get; }

        /// <summary>
        /// Gets the number of errors in the data file.
        /// </summary>
        int ErrorCount { get; }

        /// <summary>
        /// Gets the number of warnings in the data file.
        /// </summary>
        int WarningCount { get; }

        /// <summary>
        /// Gets an enumeration of the errors in the data file.
        /// </summary>
        /// <returns>The errors.</returns>
        IEnumerable<IDataSourceLoadError> GetErrors();

        /// <summary>
        /// Gets an enumeration of the warnings in the data file.
        /// </summary>
        /// <returns>The warnings.</returns>
        IEnumerable<IDataSourceLoadWarning> GetWarnings();

        /// <summary>
        /// Added a warning to the results.
        /// </summary>
        /// <param name="warning">A warning.</param>
        void AddWarning(IDataSourceLoadWarning warning);

        /// <summary>
        /// Adds an error to the results.
        /// </summary>
        /// <param name="error">An error.</param>
        void AddError(IDataSourceLoadError error);
    }
}
